package org.mat.ipaas.ucenter.bff.admin.modules.cas.controller;

import lombok.extern.slf4j.Slf4j;
import org.mat.ipaas.ucenter.service.api.cas.CasClientRestAPI;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 * CAS单点登录客户端登录认证
 * </p>
 *
 * @Author zhoujf
 * @since 2018-12-20
 */
@Slf4j
@RestController
@RequestMapping("/sys/cas/client")
public class CasClientController {

    @Autowired
    private CasClientRestAPI casClientRestAPI;

    @GetMapping("/validateLogin")
    public Object validateLogin(@RequestParam(name = "ticket") String ticket,
                                @RequestParam(name = "service") String service) throws Exception {
        return casClientRestAPI.validateLogin(ticket, service);
    }


}
